/*
package com.shiny.analysisframework.activity;

import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.*;
import com.shiny.analysisframework.R;
import com.shiny.analysisframework.activity.base.BaseActivity;

public class WebViewActivity extends BaseActivity {

    private String url = "http://www.baidu.com";
    private WebView webview;
    private ProgressDialog dialog = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);
        init();
    }

    private void init(){
        webview = (WebView)findViewById(R.id.web_view);
        webview.setNetworkAvailable(false);
        webview.loadUrl(url);

        WebSettings webSettings = webview.getSettings();
        //默认加载
        webview.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                //false:调用系统浏览器或者第三方浏览器
                view.loadUrl(url);
                return true;
            }

        });
        //支持JavaScript
        webSettings.setJavaScriptEnabled(true);
        //设置缓存加载
        webSettings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);

        //支持进度条显示变化
        webview.setWebChromeClient(new WebChromeClient(){
            @Override
            public void onProgressChanged(WebView view, int newProgress) {
                //super.onProgressChanged(view, newProgress);
                if ( 100 == newProgress ) {
                    closeDialog();
                } else {
                    openDialog(newProgress);
                }
            }
        });

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode ==  KeyEvent.KEYCODE_BACK ) {
            if ( webview.canGoBack() ) {
                webview.goBack();
                return true;

            } else {
                System.exit(0);
                return false;
            }
        }
        return super.onKeyDown(keyCode,event);
    }

    private void closeDialog() {
        if ( null != dialog && dialog.isShowing() ) {
            dialog.dismiss();
            dialog = null;
        }
    }

    private void openDialog(int newProgress) {
        if(dialog == null){
            dialog = new ProgressDialog(WebViewActivity.this);
            dialog.setTitle("Loading...");
            dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        }
        dialog.setProgress(newProgress);
        dialog.show();
    }


}
*/
